package edu.visualizetion.info.sensorcollection.pp;

import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

public class RMIClient {

	public static void main(String[] args) {
		 try {
			Registry registry = LocateRegistry.getRegistry("localhost");
			RemoteHelloWord hello = (RemoteHelloWord) registry.lookup("helloword");
			System. out.println( hello.sayHello());
			while(true){
				System.out.println(hello.sayHello());
				Thread.sleep(1000);
			}
		 } catch (RemoteException e) {
			e.printStackTrace();
		} catch (NotBoundException e) {
			e.printStackTrace();
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
}
